*gnome-extensions* is a utility that makes some common GNOME extensions
operations available on the command line.
+COMMON OPTIONS
+--------------
+All commands except for *help* and *version* handle the following options:
+
+*--quiet*, *-q*::
+Do not print error messages
+
COMMANDS
--------
*help* ['COMMAND']::
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("Create a new extension"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
+ g_option_context_add_group (context, get_option_group ());
if (do_help)
{
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("Disable an extension"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
+ g_option_context_add_group (context, get_option_group());
if (do_help)
{
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("Enable an extension"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
+ g_option_context_add_group (context, get_option_group());
if (do_help)
{
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("Show extensions info"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
+ g_option_context_add_group (context, get_option_group());
if (do_help)
{
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("Install an extension bundle"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
+ g_option_context_add_group (context, get_option_group());
if (do_help)
{
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("List installed extensions"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
+ g_option_context_add_group (context, get_option_group());
if (do_help)
{
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("Create an extension bundle"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
+ g_option_context_add_group (context, get_option_group());
if (do_help)
{
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("Opens extension preferences"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
+ g_option_context_add_group (context, get_option_group());
if (do_help)
{
/* command-reset.c
+ g_option_context_add_group (context, get_option_group());
*
* Copyright 2019 Florian Müllner <fmuellner@gnome.org>
*
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("Reset an extension"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
+ g_option_context_add_group (context, get_option_group());
if (do_help)
{
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("Uninstall an extension"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
+ g_option_context_add_group (context, get_option_group());
if (do_help)
{
DISPLAY_DETAILED
} DisplayFormat;
+GOptionGroup *get_option_group (void);
+
void show_help (GOptionContext *context,
const char *message);
return "UNKNOWN";
}
+static void
+print_nothing (const char *message)
+{
+}
+
+static gboolean
+quiet_cb (const gchar *option_name,
+ const gchar *value,
+ gpointer data,
+ GError **error)
+{
+ g_set_printerr_handler (print_nothing);
+ return TRUE;
+}
+
+GOptionGroup *
+get_option_group ()
+{
+ GOptionEntry entries[] = {
+ { .long_name = "quiet", .short_name = 'q',
+ .description = _("Do not print error messages"),
+ .arg = G_OPTION_ARG_CALLBACK, .arg_data = &quiet_cb,
+ .flags = G_OPTION_FLAG_NO_ARG | G_OPTION_FLAG_IN_MAIN },
+ { NULL }
+ };
+ GOptionGroup *group;
+
+ group = g_option_group_new ("Common", "common options", "common options", NULL, NULL);
+ g_option_group_add_entries (group, entries);
+
+ return group;
+}
+
void
show_help (GOptionContext *context, const char *message)
{